home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CBASE102.ARJ / LSGETLCK.C < prev    next >
Text File  |  1991-09-23  |  1KB  |  51 lines

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "@(#)lsgetlck.c    1.5 - 91/09/23" */
  5.  
  6. #include <ansi.h>
  7.  
  8. /* local headers */
  9. #include "lseq_.h"
  10.  
  11. /*man---------------------------------------------------------------------------
  12. NAME
  13.      lsgetlck - get lseq lock status
  14.  
  15. SYNOPSIS
  16.      #include <lseq.h>
  17.  
  18.      int lsgetlck(lsp)
  19.      lseq_t *lsp;
  20.  
  21. DESCRIPTION
  22.      The lsgetlck function reports the lock status of lseq lsp.  The
  23.      function returns the status of the lock currently held by the
  24.      calling process.  Locks held by other processes are not reported.
  25.  
  26.      The possible return values are:
  27.  
  28.           LS_UNLCK     lseq not locked
  29.           LS_RDLCK     lseq locked for reading
  30.           LS_WRLCK     lseq locked for reading and writing
  31.  
  32. SEE ALSO
  33.      lslock.
  34.  
  35. ------------------------------------------------------------------------------*/
  36. #ifdef AC_PROTO
  37. int lsgetlck(lseq_t *lsp)
  38. #else
  39. int lsgetlck(lsp)
  40. lseq_t *lsp;
  41. #endif
  42. {
  43.     if (!(lsp->flags & LSLOCKS)) {
  44.         return LS_UNLCK;
  45.     } else if (lsp->flags & LSWRLCK) {
  46.         return LS_WRLCK;
  47.     }
  48.  
  49.     return LS_RDLCK;
  50. }
  51.